﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace QLNHK.GenKey
{
    public partial class frmGenKey : Form
    {
        public frmGenKey()
        {
            InitializeComponent();
        }

        private void frmGenKey_Load(object sender, EventArgs e)
        {


        }

        private void btnTaoMaKichHoat_Click(object sender, EventArgs e)
        {
            SKGL.Generate objCreateKey = new SKGL.Generate();
            objCreateKey.secretPhase = txtMaMay.Text;
            SKGL.SerialKeyConfiguration keyConfig = new SKGL.SerialKeyConfiguration();

            string key = objCreateKey.doKey(Convert.ToInt32(txtSoNgaySuDung.Text), dtpNgayTao.DateTime, 0);
            txtMaKichHoat.Text = key;
            dtpDuocSuDungDen.DateTime = dtpNgayTao.DateTime.AddDays(Convert.ToInt32(txtSoNgaySuDung.Text));
        }
    }
}
